.class public Lorg/microemu/app/util/BuildVersion;
.super Ljava/lang/Object;
.source "BuildVersion.java"


# static fields
.field static class$org$microemu$app$util$BuildVersion:Ljava/lang/Class;


# direct methods
.method public constructor <init>()V
    .locals 0

    .prologue
    .line 37
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    return-void
.end method

.method static class$(Ljava/lang/String;)Ljava/lang/Class;
    .locals 2
    .parameter "x0"

    .prologue
    .line 40
    :try_start_0
    invoke-static {p0}, Ljava/lang/Class;->forName(Ljava/lang/String;)Ljava/lang/Class;
    :try_end_0
    .catch Ljava/lang/ClassNotFoundException; {:try_start_0 .. :try_end_0} :catch_0

    move-result-object v1

    return-object v1

    :catch_0
    move-exception v0

    .local v0, x1:Ljava/lang/ClassNotFoundException;
    new-instance v1, Ljava/lang/NoClassDefFoundError;

    invoke-direct {v1}, Ljava/lang/NoClassDefFoundError;-><init>()V

    invoke-virtual {v1, v0}, Ljava/lang/NoClassDefFoundError;->initCause(Ljava/lang/Throwable;)Ljava/lang/Throwable;

    move-result-object v1

    throw v1
.end method

.method public static getVersion()Ljava/lang/String;
    .locals 8

    .prologue
    const-string v7, "org.microemu.app.util.BuildVersion"

    .line 40
    sget-object v5, Lorg/microemu/app/util/BuildVersion;->class$org$microemu$app$util$BuildVersion:Ljava/lang/Class;

    if-nez v5, :cond_1

    const-string v5, "org.microemu.app.util.BuildVersion"

    invoke-static {v7}, Lorg/microemu/app/util/BuildVersion;->class$(Ljava/lang/String;)Ljava/lang/Class;

    move-result-object v5

    sput-object v5, Lorg/microemu/app/util/BuildVersion;->class$org$microemu$app$util$BuildVersion:Ljava/lang/Class;

    :goto_0
    const-string v6, "/META-INF/microemulator-build.version"

    invoke-virtual {v5, v6}, Ljava/lang/Class;->getResourceAsStream(Ljava/lang/String;)Ljava/io/InputStream;

    move-result-object v1

    .line 42
    .local v1, buildVersionInputStream:Ljava/io/InputStream;
    if-eqz v1, :cond_3

    .line 43
    new-instance v3, Ljava/util/Properties;

    invoke-direct {v3}, Ljava/util/Properties;-><init>()V

    .line 45
    .local v3, projectProperties:Ljava/util/Properties;
    :try_start_0
    invoke-virtual {v3, v1}, Ljava/util/Properties;->load(Ljava/io/InputStream;)V

    .line 46
    const-string v5, "build.version"

    invoke-virtual {v3, v5}, Ljava/util/Properties;->getProperty(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v4

    .line 47
    .local v4, version:Ljava/lang/String;
    if-eqz v4, :cond_2

    .line 48
    const-string v5, "build.buildNum"

    invoke-virtual {v3, v5}, Ljava/util/Properties;->getProperty(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v0

    .line 49
    .local v0, buildNumber:Ljava/lang/String;
    if-eqz v0, :cond_0

    .line 50
    new-instance v5, Ljava/lang/StringBuffer;

    invoke-direct {v5}, Ljava/lang/StringBuffer;-><init>()V

    invoke-virtual {v5, v4}, Ljava/lang/StringBuffer;->append(Ljava/lang/String;)Ljava/lang/StringBuffer;

    move-result-object v5

    const-string v6, "."

    invoke-virtual {v5, v6}, Ljava/lang/StringBuffer;->append(Ljava/lang/String;)Ljava/lang/StringBuffer;

    move-result-object v5

    invoke-virtual {v5, v0}, Ljava/lang/StringBuffer;->append(Ljava/lang/String;)Ljava/lang/StringBuffer;

    move-result-object v5

    invoke-virtual {v5}, Ljava/lang/StringBuffer;->toString()Ljava/lang/String;
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0
    .catch Ljava/io/IOException; {:try_start_0 .. :try_end_0} :catch_0

    move-result-object v4

    .line 56
    :cond_0
    invoke-static {v1}, Lorg/microemu/app/util/IOUtils;->closeQuietly(Ljava/io/InputStream;)V

    move-object v5, v4

    .line 75
    .end local v3           #projectProperties:Ljava/util/Properties;
    .end local v0           #buildNumber:Ljava/lang/String;
    .end local v4           #version:Ljava/lang/String;
    :goto_1
    return-object v5

    .line 40
    .end local v1           #buildVersionInputStream:Ljava/io/InputStream;
    :cond_1
    sget-object v5, Lorg/microemu/app/util/BuildVersion;->class$org$microemu$app$util$BuildVersion:Ljava/lang/Class;

    goto :goto_0

    .line 56
    .restart local v1       #buildVersionInputStream:Ljava/io/InputStream;
    .restart local v3       #projectProperties:Ljava/util/Properties;
    .restart local v4       #version:Ljava/lang/String;
    :cond_2
    invoke-static {v1}, Lorg/microemu/app/util/IOUtils;->closeQuietly(Ljava/io/InputStream;)V

    .line 60
    .end local v3           #projectProperties:Ljava/util/Properties;
    .end local v4           #version:Ljava/lang/String;
    :cond_3
    :goto_2
    sget-object v5, Lorg/microemu/app/util/BuildVersion;->class$org$microemu$app$util$BuildVersion:Ljava/lang/Class;

    if-nez v5, :cond_4

    const-string v5, "org.microemu.app.util.BuildVersion"

    invoke-static {v7}, Lorg/microemu/app/util/BuildVersion;->class$(Ljava/lang/String;)Ljava/lang/Class;

    move-result-object v5

    sput-object v5, Lorg/microemu/app/util/BuildVersion;->class$org$microemu$app$util$BuildVersion:Ljava/lang/Class;

    :goto_3
    const-string v6, "/META-INF/maven/org.microemu/microemu-javase/pom.properties"

    invoke-virtual {v5, v6}, Ljava/lang/Class;->getResourceAsStream(Ljava/lang/String;)Ljava/io/InputStream;

    move-result-object v2

    .line 62
    .local v2, mavenDataInputStream:Ljava/io/InputStream;
    if-eqz v2, :cond_6

    .line 63
    new-instance v3, Ljava/util/Properties;

    invoke-direct {v3}, Ljava/util/Properties;-><init>()V

    .line 65
    .restart local v3       #projectProperties:Ljava/util/Properties;
    :try_start_1
    invoke-virtual {v3, v2}, Ljava/util/Properties;->load(Ljava/io/InputStream;)V

    .line 66
    const-string v5, "version"

    invoke-virtual {v3, v5}, Ljava/util/Properties;->getProperty(Ljava/lang/String;)Ljava/lang/String;
    :try_end_1
    .catchall {:try_start_1 .. :try_end_1} :catchall_1
    .catch Ljava/io/IOException; {:try_start_1 .. :try_end_1} :catch_1

    move-result-object v4

    .line 67
    .restart local v4       #version:Ljava/lang/String;
    if-eqz v4, :cond_5

    .line 72
    invoke-static {v2}, Lorg/microemu/app/util/IOUtils;->closeQuietly(Ljava/io/InputStream;)V

    move-object v5, v4

    goto :goto_1

    .line 54
    .end local v2           #mavenDataInputStream:Ljava/io/InputStream;
    .end local v4           #version:Ljava/lang/String;
    :catch_0
    move-exception v5

    .line 56
    invoke-static {v1}, Lorg/microemu/app/util/IOUtils;->closeQuietly(Ljava/io/InputStream;)V

    goto :goto_2

    :catchall_0
    move-exception v5

    invoke-static {v1}, Lorg/microemu/app/util/IOUtils;->closeQuietly(Ljava/io/InputStream;)V

    throw v5

    .line 60
    .end local v3           #projectProperties:Ljava/util/Properties;
    :cond_4
    sget-object v5, Lorg/microemu/app/util/BuildVersion;->class$org$microemu$app$util$BuildVersion:Ljava/lang/Class;

    goto :goto_3

    .line 72
    .restart local v2       #mavenDataInputStream:Ljava/io/InputStream;
    .restart local v3       #projectProperties:Ljava/util/Properties;
    .restart local v4       #version:Ljava/lang/String;
    :cond_5
    invoke-static {v2}, Lorg/microemu/app/util/IOUtils;->closeQuietly(Ljava/io/InputStream;)V

    .line 75
    .end local v3           #projectProperties:Ljava/util/Properties;
    .end local v4           #version:Ljava/lang/String;
    :cond_6
    :goto_4
    const-string v5, "n/a"

    goto :goto_1

    .line 70
    .restart local v3       #projectProperties:Ljava/util/Properties;
    :catch_1
    move-exception v5

    .line 72
    invoke-static {v2}, Lorg/microemu/app/util/IOUtils;->closeQuietly(Ljava/io/InputStream;)V

    goto :goto_4

    :catchall_1
    move-exception v5

    invoke-static {v2}, Lorg/microemu/app/util/IOUtils;->closeQuietly(Ljava/io/InputStream;)V

    throw v5
.end method
